import csv
# with open("score.csv","a",encoding="utf-8") as f:
#     f.write("\njack,78")
#     f.write("\njack1,78")

# with open("score.csv","a",encoding="utf-8") as f:
#     writer1 = csv.writer(f)
#     writer1.writerow(['anby1',78])# 写一行数据，数据类型必须是列表形式  默认前面不加换行符，但是结尾加换行符
#     writer1.writerows([["张三",90],['李四',78],['王五',89]])

with open("score.csv","a",encoding="utf-8") as f:
    w = csv.DictWriter(f,fieldnames=["姓名","成绩"])
    w.writerow({"姓名":"mandy","成绩":67})
    w.writerows([{"姓名":"mandy1","成绩":67},{"姓名":"mandy2","成绩":67},{"姓名":"mandy3","成绩":67}])
